package com.ag.lwc.service.impl;

import java.util.List;

import com.ag.bean.TbEventInfect;
import com.ag.common.AgException;
import com.ag.dao.TbEventDAO;
import com.ag.lwc.dao.MyTbEventInfectDAO;
import com.ag.lwc.service.EventInfectService;

public class EventInfectServiceImpl implements EventInfectService {
	private MyTbEventInfectDAO eventInfectDAO;
	private TbEventDAO eventDAO;

	@Override
	public void delete(TbEventInfect eventInfect) {
	//暂时什么都不做
	}

	@Override
	public void delete(String id) {
		//根据Id删除事件影响范围
		if(id==null) return;
		eventInfectDAO.delete(id);
		System.out.println("****************删除事件影响范围："+id+"************************");

	}

	@Override
	public List<TbEventInfect> find(String eventId) {
		System.out.println("****************事件Id："+eventId+"  *****************");
		if(eventId==null) return null;
		return eventInfectDAO.find(eventId);
	}

	@Override
	public TbEventInfect findById(String id) {
		System.out.println("*****************影响范围id："+id+"  *********************");
		if(id==null) return null;
		return eventInfectDAO.findById(id);
	}

	@Override
	public void save(TbEventInfect eventInfect) throws AgException {
		System.out.println("***************要保存的影响范围编号："+eventInfect.getEiId()+"  **************");
		if(eventInfect==null) return ;
		eventInfectDAO.save(eventInfect);
	}

	@Override
	public void update(TbEventInfect eventInfect) {
		if(eventInfect==null||eventInfect.getTbEvent()==null||eventInfect.getTbEvent().getEId()==null) return;
		eventInfectDAO.attachDirty(eventInfect);

	}

	public MyTbEventInfectDAO getEventInfectDAO() {
		return eventInfectDAO;
	}

	public void setEventInfectDAO(MyTbEventInfectDAO eventInfectDAO) {
		this.eventInfectDAO = eventInfectDAO;
	}

	public TbEventDAO getEventDAO() {
		return eventDAO;
	}

	public void setEventDAO(TbEventDAO eventDAO) {
		this.eventDAO = eventDAO;
	}

}
